package cc.rengu.oltp.utility.bean;

/**
 * Redis连接池信息
 * Created by wangc on 2020/12/14.
 */
public class RedisConfig {
    private String classPath = "cc.rengu.oltp.service.realize.impl.RedisServiceImpl";    /* Redis客户端实现类 */
    private boolean clusterFlag = false;   /* 集群标识 */
    private boolean forceRefleshFlag = false;     /* 强制刷新缓存标识 */
    private int maxTotal = 10000;   /* 最大分配的对象数 */
    private int maxIdle = 200;     /* 最大能够保持idle状态的对象数 */
    private long maxWaitMillis = 1000L;    /* 最大等待时间 */
    private boolean testOnBorrow = true;    /* 在获取连接时有效性检查标志 */
    private boolean testOnReturn = true;    /* 释放连接到连接池时有效性检查标志 */
    private boolean testWhileIdle = true;    /* 空闲时连接有效性检查标志 */
    private String clusterNodes = null;   /* 集群模式节点列表 */
    private String clusterMode = "cluster";     /* 集群模式 */
    private String masterName = null;   /* 哨兵模式主节点 */
    private int maxRedirects = 3;  /* 最大重定向数目 */
    private int maxAttempts = 5;  /* 集群模式重连尝试次数 */
    private String host = "127.0.0.1";   /* 单机模式主机地址 */
    private int port = 6379;   /* 单机模式主机端口 */
    private int timeout = 2000;    /* 超时时间 */
    private String password;    /* 密码 */
    private int dataBaseNo = 0;    /* 数据库编号 */

    public String getClassPath() {
        return classPath;
    }

    public void setClassPath(String classPath) {
        this.classPath = classPath;
    }

    public boolean isClusterFlag() {
        return clusterFlag;
    }

    public void setClusterFlag(boolean clusterFlag) {
        this.clusterFlag = clusterFlag;
    }

    public boolean isForceRefleshFlag() {
        return forceRefleshFlag;
    }

    public void setForceRefleshFlag(boolean forceRefleshFlag) {
        this.forceRefleshFlag = forceRefleshFlag;
    }

    public int getMaxTotal() {
        return maxTotal;
    }

    public void setMaxTotal(int maxTotal) {
        this.maxTotal = maxTotal;
    }

    public int getMaxIdle() {
        return maxIdle;
    }

    public void setMaxIdle(int maxIdle) {
        this.maxIdle = maxIdle;
    }

    public long getMaxWaitMillis() {
        return maxWaitMillis;
    }

    public void setMaxWaitMillis(long maxWaitMillis) {
        this.maxWaitMillis = maxWaitMillis;
    }

    public boolean isTestOnBorrow() {
        return testOnBorrow;
    }

    public void setTestOnBorrow(boolean testOnBorrow) {
        this.testOnBorrow = testOnBorrow;
    }

    public boolean isTestOnReturn() {
        return testOnReturn;
    }

    public void setTestOnReturn(boolean testOnReturn) {
        this.testOnReturn = testOnReturn;
    }

    public boolean isTestWhileIdle() {
        return testWhileIdle;
    }

    public void setTestWhileIdle(boolean testWhileIdle) {
        this.testWhileIdle = testWhileIdle;
    }

    public String getClusterNodes() {
        return clusterNodes;
    }

    public void setClusterNodes(String clusterNodes) {
        this.clusterNodes = clusterNodes;
    }

    public String getClusterMode() {
        return clusterMode;
    }

    public void setClusterMode(String clusterMode) {
        this.clusterMode = clusterMode;
    }

    public String getMasterName() {
        return masterName;
    }

    public void setMasterName(String masterName) {
        this.masterName = masterName;
    }

    public int getMaxRedirects() {
        return maxRedirects;
    }

    public void setMaxRedirects(int maxRedirects) {
        this.maxRedirects = maxRedirects;
    }

    public int getMaxAttempts() {
        return maxAttempts;
    }

    public void setMaxAttempts(int maxAttempts) {
        this.maxAttempts = maxAttempts;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public int getTimeout() {
        return timeout;
    }

    public void setTimeout(int timeout) {
        this.timeout = timeout;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getDataBaseNo() {
        return dataBaseNo;
    }

    public void setDataBaseNo(int dataBaseNo) {
        this.dataBaseNo = dataBaseNo;
    }
}
